<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'showAboutUs.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<LINK href="<%=basePath%>/css/main.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">

function updateAboutUS(id){
	window.location="TrainStrengthServlet?action=toUpdate&strengthID="+id;	
}

function check(){
	if(document.getElementById("allcheck").checked){
		var list = document.getElementsByName("checkb");
		for(var i=0;i<list.length;i++){
			list[i].checked="checked";
		}

	}else{
		
		var list = document.getElementsByName("checkb");
		for(var i=0;i<list.length;i++){
			list[i].checked="";
		}
	}
}	

function deleteAll(){
	if(window.confirm("确定删除所有选中的文章？")){
		var list = document.getElementsByName("checkb");
		var arr = new Array();
		for(var i=0,j=0;i<list.length;i++){
			if(list[i].checked){
				arr[j]=list[i].value;
				j++;
			}
		}
		window.location="TrainStrengthServlet?action=deleteAll&auidList="+arr;
		alert("删除成功！");
	}	
}

function deleteAboutUs(id){
	if(window.confirm("确定删除？")){
		window.location="TrainStrengthServlet?action=delete&strengthID="+id;
		alert("删除成功！");
	}	
}


	
</script>
</head>

<body>
<table border="0" width="90%" cellspacing="0" cellpadding="3"
	class="small">
	<tr>
		<td class="Big" width="270"><img
			src="<%=basePath%>/img/menu/@finance.gif" align="absmiddle"><span
			class="big3"> 培训优势列表</span><br>
		</td>

	</tr>
</table>

<table class="TableBlock" width="700" align="center">
	<tr align="center">
		<td class="showBig"><a>选择</a></td>
		<td class="showBig" width="60%"><b>标题</b></td>

		<td class="showBig" width="120"><b>操作</b></td>
	</tr>

	<c:forEach items="${list}" var="tslist">

		<tr>
			<td class="TableData" align="center"><input type="checkbox"
				name="checkb" value="${tslist.strengthID }" /></td>
			<td class="TableData"><a
				href="TrainStrengthServlet?action=display&strengthID=${tslist.strengthID }">${tslist.strengthTitle
			}</a></td>

			<td class="TableData" align="left"><input type="button"
				value="修改" class="SmallButton"
				onclick='updateAboutUS(${tslist.strengthID });' />&nbsp;&nbsp; <input
				type="button" class="SmallButton"
				onclick="deleteAboutUs(${tslist.strengthID })" value="删除" />
			&nbsp;&nbsp;</td>



		</tr>
	</c:forEach>


	<tr>
		<td class="TableData" align="center"><input type="checkbox"
			name="allcheck" onclick="check()" />全选</td>
		<td class="TableData">共 1 页 <a href="">上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;<a
			href="">下一页</a></td>

		<td class="TableData"><input type="button" onclick="deleteAll()"
			class="SmallButton" value="删除选中的" /></td>
	</tr>



</table>
</body>
</html>
